package com.etc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HiController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("hi")
    public String hi () {
        // 用java代码 发送http请求
        String msg  = restTemplate.getForObject("http://EUREKA-REGIST/hi", String.class);
        return msg;
    }
}
